<template>
  <Form :validation-schema="schema" @submit="onSubmit">
    <Field name="email" type="email" />
    <ErrorMessage name="email" />
    <Field name="password" type="password" />
    <ErrorMessage name="password" />
    <button type="Submit">Submit</button>
    <button type="reset">Reset</button>
  </Form>
</template>
<script setup>
import { Field, Form } from 'vee-validate';
import { z } from 'zod';

const schema = z.object({
  email: z.string().min(1, { message: 'Email is required' }),
  password: z.string().min(1, { message: 'Password is required' }),
});

const onSubmit = (values, { resetForm }) => {
  resetForm();
};
</script>
